package xyz.labmem.base.core.annotion

import java.lang.annotation.Inherited

/**
 * 分页动态表头
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
annotation class DynamicChartColumn(
    val value: String = "",
    /**
     * 排序，大于0唯一值
     */
    val order: Int = 0,

    val unit : String = "",
)

/**
 * 分页动态表头
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
annotation class DynamicChartColumn2(
    val value: String = "",
    /**
     * 排序，大于0唯一值
     */
    val order: Int = 0,

    val unit : String = "",
)

/**
 * 分页动态表头
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
annotation class DynamicPageColumn(
    /**
     * 排序，大于0唯一值
     */
    val order: Int = 0,

    //是否隐藏
    val hide: Boolean = false,

    //表头标识，用于分组
    val flag: String = "",
)

/**
 * 分页动态表头全局
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
annotation class DynamicPageColumnMapping(
    /**
     * 显示表头配置DynamicBaseColumn[]
     * 例:[DynamicBaseColumn(order=1,name="id")]
     * PS:父类属性要有ApiModelProperty注解才能识别取到注释
     */
    val showField: Array<DynamicBaseColumn> = [],

    /**
     * 隐藏表头配置，适用于showAll
     */
    val hiedField: Array<String> = [],

    /**
     * 获取所有字段作为动态表头(包括父)
     */
    val showAll: Boolean = true

)


/**
 * 分页动态表头全局
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS)
annotation class DynamicPageColumn1Mapping(

    /**
     * 隐藏表头配置，适用于showAll
     */
    val hiedField: Array<String> = [],
    val openType : Boolean = true
)
/**
 * 公共表头
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
annotation class DynamicBaseColumn(
    /**
     * 排序：大于0唯一值
     */
    val order: Int = 0,

    //继承父字段名
    val name: String
)
/**
 * sql查询
 * @Author lty
 * @Date 2021/12/15 14:38
 */
@Inherited
@Target(AnnotationTarget.FIELD)
@Retention(AnnotationRetention.RUNTIME)
annotation class SqlColumn(
    /**
     * 排序，大于0唯一值
     */
    val order: Int = 0,

    //是否隐藏
    val value: Boolean = true,

    //单位名称
    val unit: Boolean = false
)